package com.aw.qzblog.handle;


import com.aw.qzblog.common.Result;
import com.aw.qzblog.exception.SysException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = SysException.class)
    public Result handleSysException(SysException e) {
        return Result.fail(e);
    }

}
